<?php
defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' );
class Standard_model extends CI_Model {
	public function __construct() {
		parent::__construct ();
	}
	/*
	 * 添加标准营养信息
	 */
	public function create($standard){
		$this->db->insert('t_standard', $standard);
		return $this->db->insert_id();
	}
	/*
	 * 根据年龄和性别得到标准营养信息
	 */
	public function find_by_age($age,$gender) {
		$this->db->where('age',$age);
		$this->db->where('gender',$gender);
		$query = $this->db->get('t_standard');
		return $query->row_array();
	}
}